{extend name="../../admin/view/main"}

{block name='content'}

<div class="layui-row layui-col-space15 margin-top-10">

    <div class="layui-col-xs12 layui-col-xs12">

        <div class="think-box-shadow">
            <div id="main5" style="width:100%;height:350px"></div>
        </div>
    </div>

</div>

<script>

    window.form.render();
    let getMain5 = function () {
        $.ajax({
            type: "post",           //传输方式 get/post
            url: "{:url('record.car_record_analyze/overview')}",       //传输地址（后台地址）
            dataType: "json",                  //接收数据形式
            success: function (res) {
                let data5 = res.data
                require(['echarts'], function (echarts) {
                    (function (charts) {
                        window.addEventListener("resize", function () {
                            charts.resize()
                        });
                        charts.setOption({
                            title: [{left: 'right', text: '未喷漆分析饼状图'}],
                            tooltip: {trigger: 'item'},
                            legend: {
                                orient: 'vertical',
                                left: 'left'
                            },
                            series: [
                                {
                                    name: '车型销量',
                                    type: 'pie',
                                    radius: '50%',
                                    data: data5,
                                    emphasis: {
                                        itemStyle: {
                                            shadowBlur: 10,
                                            shadowOffsetX: 0,
                                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                                        }
                                    }
                                }
                            ]
                        });
                    })(echarts.init(document.getElementById('main5')));
                })
            }
        })

    }

    getMain5();
</script>

{/block}
